package com.unicorn.config;

import com.unicorn.annotation.MyConditionOnClass;
import com.unicorn.server.JettyServer;
import com.unicorn.server.TomcatServer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description
 * @Author Meng.shen
 * @Date 2022/12/6
 **/
@Configuration
public class WebServerConfig implements AutoConfiguration{

    @Bean
    @MyConditionOnClass("org.apache.catalina.startup.Tomcat")
    public TomcatServer tomcatServer(){
        return new TomcatServer();
    }

    @Bean
    @MyConditionOnClass("org.eclipse.jetty.server.Server")
    public JettyServer jettyServer() {
        return new JettyServer();
    }

}
